<?php

namespace App\Events;

use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

class PayEvent
{
    use Dispatchable, InteractsWithSockets, SerializesModels;

    public $manager_id;
    public $server_id;
    public $player_id;
    public $order_num;
    public $type; //1客户充值  3玩家充值
    public $money;
    public $payway;
    public $state;
    public $info;
    public $pay_purpose;

    /**
     * Create a new event instance.
     *
     * @return void
     */
    public function __construct($manager_id,$server_id,$player_id,$order_num,$type,$money,$payway,$state,$info,$pay_purpose)
    {
        //
        $this->manager_id = $manager_id;
        $this->server_id = $server_id;
        $this->player_id = $player_id;
        $this->order_num = $order_num;
        $this->type = $type;
        $this->money = $money;
        $this->payway = $payway;
        $this->state = $state;
        $this->info = $info;
        $this->pay_purpose = $pay_purpose;
    }

    /**
     * Get the channels the event should broadcast on.
     *
     * @return \Illuminate\Broadcasting\Channel|array
     */
    public function broadcastOn()
    {
        return new PrivateChannel('channel-name');
    }
}
